.Dd May 18, 2010
.Dt PBI_AUTOBUILD 8
.Os
.Sh NAME
.Nm pbi_autobuild
.Nd Auto-build all PBIs from a meta-data tree
.Sh SYNOPSIS
.Nm
.Op Fl c Ar confdir
.Op Fl d Ar portdir
.Op Fl o Ar outdir
.Op Fl h Ar script
.Op Fl -genpatch
.Op Fl -keep Ar num
.Op Fl -pkgcache
.Op Fl -prune
.Op Fl -tmpfs
.Op Fl -sign Ar keyfile
.Sh DESCRIPTION
The utility,
.Nm ,
can be used to traverse a directory of meta-data configuration modules for PBIs,
and auto-build any out of date or new packages. 
.Pp
.Sh OPTIONS
.Bl -tag -width indent
.It Fl c Ar confdir
Specify the meta-data confdir to traverse. The autobuild function will look for
directories with a ".pbi.conf" file within, and use that directory in the PBI
building process. 

Any found pbi.conf files will be parsed, and if PBI_MAKEPORT is set, the target
port will be used for the build. If PBI_MAKEPORT is unset, the auto-build will
attempt to match the module to a FreeBSD port based upon the dirname of pbi.conf
.It Fl d Ar portsdir
Specify an alternative ports-dir, defaults to /usr/ports
.It Fl h Ar script
Specify a helper script to call after building a PBI. The following
arguments will be passed: $1 - (OK/FAILED), $2 - (Output directory of PBI/Logs)
.It Fl o Ar outdir
The directory to place the finished PBI files, will also be used to determine
which apps are in need of a rebuild if the associated FreeBSD port has been updated.
.It Fl -genpatch
When building a new PBI, check for archived copies, and generate smaller patch
updates to the new version. (*.pbp files)
.It Fl -keep Ar num
When building new PBIs, keep <num> copies of past versions of working PBI in 
<outdir>/archived/ folder. These archived copies can be used with the --genpatch 
command to generate update patch files.
.It Fl -pkgcache
Enable caching of .txz pkg files. Files will be saved in each PBIs <outdir>/pkgcache
directory. This greatly speeds up subsequent builds of a PBI, since the cached packages
will be used wherever possible. 
.It Fl -prune
Remove any PBIs which no longer have an associated module in confdir. 
.It Fl -tmpfs
Automatically create and mount a TMPFS file system and use it for WRKDIRPREFIX.
This can be used to speed up port compiles on systems with available RAM.
.It Fl -sign Ar keyfile
Digitially sign the PBI file with the openssl private key file specified
.Sh NOTES
For details about the module format, please refer to the wiki guide:
http://wiki.pcbsd.org/index.php/PBI_Module_Builder_Guide
.Sh SEE ALSO
.Xr pbi_add 1 ,
.Xr pbi_create 1 ,
.Xr pbi_makeport 1
